package com.oocl.aeat.util;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Properties;

public class ServerConfig {
	public static String JMS_USERNAME;
	public static String JMS_PASSWORD;
	public static String JMS_TCP_CONNNECTION_URL;
	public static String JMS_CONSUMER_QUEUE;
	public static String JMS_PRODUCER_QUEUE;
	
	public static String NGINX_IMAGE_URL;
	public static String NGINX_IMAGE_LOCAL_PATH;
	
	public static String JDBC_DRIVERCLASS;
	public static String JDBC_DRIVERURL;
	public static String JDBC_USERNAME;
	public static String JDBC_PASSWORD;
	
	private static ServerConfig instance;  
	
	static{
		if(instance == null){
			instance = new ServerConfig();
		}
	}
	
	private ServerConfig() {
		Properties properties = new Properties();
		try {
			properties.load(new FileInputStream("C:/Java/apache-tomcat-7.0.79/webapps/aeat/WEB-INF/classes/server.properties"));
			JMS_USERNAME             = properties.getProperty("JMS_USERNAME");
			JMS_PASSWORD             = properties.getProperty("JMS_PASSWORD");
			JMS_TCP_CONNNECTION_URL  = properties.getProperty("JMS_TCP_CONNNECTION_URL");
			JMS_CONSUMER_QUEUE       = properties.getProperty("JMS_CONSUMER_QUEUE");
			JMS_PRODUCER_QUEUE       = properties.getProperty("JMS_PRODUCER_QUEUE");

			NGINX_IMAGE_URL           = properties.getProperty("NGINX_IMAGE_URL");
			NGINX_IMAGE_LOCAL_PATH   = properties.getProperty("NGINX_IMAGE_LOCAL_PATH");

			JDBC_DRIVERCLASS         = properties.getProperty("JDBC_DRIVERCLASS");
			JDBC_DRIVERURL           = properties.getProperty("JDBC_DRIVERURL");
			JDBC_USERNAME            = properties.getProperty("JDBC_USERNAME");
			JDBC_PASSWORD            = properties.getProperty("JDBC_PASSWORD");
		
			
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		}
		
	}
}
